<% if doc %>
  <div class="doc-item list-item list-avatar" id="doc-<%= doc.id %>">
    <div class="avatar-box icon-box icon-doc">
      <%= icon_tag("avatar-doc") %>
    </div>
    <div class="title text-overflow icon-middle-wrap d-flex">
      <%= doc_title_tag(doc) %>
      <% if doc.share %>
        <i class="fas fa-share ml-2"></i>
      <% end %>
    </div>
    <span class="time-box"><%= timeago doc.body_updated_at %></span>
    <div class="path">
      <% if @repository && doc.repository_id != @repository.id %>
      <%= user_name_icon_tag(doc.repository&.user, with_icon: true) %> /
      <%= repository_name_tag(doc.repository, with_icon: true) %>
      <% end %>
      <%= user_name_tag(doc.last_editor) %>
    </div>
    <div class="action action-icon text-gray">
      <%= link_to icon_tag("edit"), doc.to_path("/edit") %>
      <% if can? :destroy, doc %>
        <%= link_to icon_tag("delete"), doc.to_path, data: { method: :delete, remote: true, confirm: t(".Are you sure delete this Doc?") }, class: "btn-link btn-remove-doc" %>
      <% end %>
    </div>
  </div>
<% end %>
